package utils
{
import flash.utils.getQualifiedClassName;


public class VectorUtil
{
	public static function removeObject(object:*, vector:*):*
	{
		var index:int = -1;
		for (var i:int = 0; i < vector.length; i++)
		{
			if (object == vector[i])
			{
				index = i;
				break;
			}
		}
		if (index >= 0) vector.splice(index, 1);
		return vector;
	}
	
	public static function toArray(vector:*):Array
	{
		var list:Array = [];
		for (var i:int = 0; i < vector.length; i++)
		{
			list.push(vector[i]);
		}
		return list;
	}
	
	public static function isVector(object:Object):Boolean 
	{
		var class_name:String = getQualifiedClassName(object);
		return class_name.indexOf("__AS3__.vec::Vector.") === 0;
	}
}
}